/**
 * 校园二手交易平台 - 分类Mock数据
 * 提供商品分类相关的模拟数据
 */

import { Category, CategoryTreeNode, CategoryStats, CategoryStatus } from '../types/category';

/**
 * 分类数据
 */
export const mockCategories: any[] = [
  // 一级分类
  {
    id: 'electronics',
    name: '电子产品',
    description: '手机、电脑、平板、耳机等电子产品',
    level: 1,
    parentId: null,
    icon: '📱',
    sortOrder: 1,
    status: CategoryStatus.ENABLED,
    productCount: 1567,
    viewCount: 28945,
    favoriteCount: 1234,
    isLeaf: false,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'books',
    name: '教材资料',
    description: '教材、参考书、考研资料等学习资料',
    level: 1,
    parentId: null,
    icon: '📚',
    sortOrder: 2,
    status: CategoryStatus.ENABLED,
    productCount: 2345,
    viewCount: 45678,
    favoriteCount: 1789,
    isLeaf: false,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'clothing',
    name: '服装服饰',
    description: '衣服、鞋子、配饰等服装类商品',
    level: 1,
    parentId: null,
    icon: '👕',
    sortOrder: 3,
    status: CategoryStatus.ENABLED,
    productCount: 987,
    viewCount: 15678,
    favoriteCount: 456,
    isLeaf: false,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'daily',
    name: '生活用品',
    description: '日用品、宿舍用品、家居用品等',
    level: 1,
    parentId: null,
    icon: '🏠',
    sortOrder: 4,
    status: CategoryStatus.ENABLED,
    productCount: 765,
    viewCount: 12345,
    favoriteCount: 345,
    isLeaf: false,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'sports',
    name: '运动器材',
    description: '体育用品、健身器材、运动装备等',
    level: 1,
    parentId: null,
    icon: '⚽',
    sortOrder: 5,
    status: CategoryStatus.ENABLED,
    productCount: 543,
    viewCount: 9876,
    favoriteCount: 234,
    isLeaf: false,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },

  // 电子产品子分类
  {
    id: 'mobile',
    name: '手机',
    description: '智能手机、功能手机等',
    level: 2,
    parentId: 'electronics',
    icon: '📱',
    sortOrder: 1,
    status: CategoryStatus.ENABLED,
    productCount: 456,
    viewCount: 12345,
    favoriteCount: 567,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'laptop',
    name: '笔记本电脑',
    description: '笔记本电脑、平板电脑等',
    level: 2,
    parentId: 'electronics',
    icon: '💻',
    sortOrder: 2,
    status: CategoryStatus.ENABLED,
    productCount: 345,
    viewCount: 9876,
    favoriteCount: 456,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'audio',
    name: '音频设备',
    description: '耳机、音箱、麦克风等音频设备',
    level: 2,
    parentId: 'electronics',
    icon: '🎧',
    sortOrder: 3,
    status: CategoryStatus.ENABLED,
    productCount: 234,
    viewCount: 7654,
    favoriteCount: 345,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },

  // 教材资料子分类
  {
    id: 'computer_books',
    name: '计算机类',
    description: '计算机相关教材和参考书',
    level: 2,
    parentId: 'books',
    icon: '💻',
    sortOrder: 1,
    status: CategoryStatus.ENABLED,
    productCount: 567,
    viewCount: 15678,
    favoriteCount: 678,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'english_books',
    name: '英语类',
    description: '英语学习教材和参考书',
    level: 2,
    parentId: 'books',
    icon: '🔤',
    sortOrder: 2,
    status: CategoryStatus.ENABLED,
    productCount: 456,
    viewCount: 12345,
    favoriteCount: 567,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'math_books',
    name: '数学类',
    description: '数学教材和参考书',
    level: 2,
    parentId: 'books',
    icon: '➕',
    sortOrder: 3,
    status: CategoryStatus.ENABLED,
    productCount: 345,
    viewCount: 9876,
    favoriteCount: 456,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },

  // 服装服饰子分类
  {
    id: 'shoes',
    name: '鞋子',
    description: '运动鞋、休闲鞋等鞋类商品',
    level: 2,
    parentId: 'clothing',
    icon: '👟',
    sortOrder: 1,
    status: CategoryStatus.ENABLED,
    productCount: 234,
    viewCount: 7654,
    favoriteCount: 234,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  },
  {
    id: 'tops',
    name: '上衣',
    description: 'T恤、卫衣、衬衫等上衣类商品',
    level: 2,
    parentId: 'clothing',
    icon: '👕',
    sortOrder: 2,
    status: CategoryStatus.ENABLED,
    productCount: 198,
    viewCount: 6543,
    favoriteCount: 198,
    isLeaf: true,
    createdAt: new Date('2024-01-01T00:00:00Z'),
    updatedAt: new Date('2024-10-18T00:00:00Z')
  }
];

/**
 * 分类树数据
 */
export const mockCategoryTree: any[] = [
  {
    id: 'electronics',
    name: '电子产品',
    level: 1,
    children: [
      {
        id: 'mobile',
        name: '手机',
        level: 2,
        children: []
      },
      {
        id: 'laptop',
        name: '笔记本电脑',
        level: 2,
        children: []
      },
      {
        id: 'audio',
        name: '音频设备',
        level: 2,
        children: []
      }
    ]
  },
  {
    id: 'books',
    name: '教材资料',
    level: 1,
    children: [
      {
        id: 'computer_books',
        name: '计算机类',
        level: 2,
        children: []
      },
      {
        id: 'english_books',
        name: '英语类',
        level: 2,
        children: []
      },
      {
        id: 'math_books',
        name: '数学类',
        level: 2,
        children: []
      }
    ]
  },
  {
    id: 'clothing',
    name: '服装服饰',
    level: 1,
    children: [
      {
        id: 'shoes',
        name: '鞋子',
        level: 2,
        children: []
      },
      {
        id: 'tops',
        name: '上衣',
        level: 2,
        children: []
      }
    ]
  },
  {
    id: 'daily',
    name: '生活用品',
    level: 1,
    children: []
  },
  {
    id: 'sports',
    name: '运动器材',
    level: 1,
    children: []
  }
];

/**
 * 分类统计信息
 */
export const mockCategoryStats: any[] = [
  {
    totalProducts: 1567,
    activeProducts: 1345,
    totalViews: 28945,
    totalFavorites: 1234,
    avgPrice: 1567.89,
    successRate: 85.2,
    dailyViews: 156,
    weeklyGrowth: 12.3
  },
  {
    totalProducts: 2345,
    activeProducts: 1987,
    totalViews: 45678,
    totalFavorites: 1789,
    avgPrice: 45.67,
    successRate: 78.9,
    dailyViews: 234,
    weeklyGrowth: 8.7
  },
  {
    totalProducts: 987,
    activeProducts: 765,
    totalViews: 15678,
    totalFavorites: 456,
    avgPrice: 123.45,
    successRate: 67.8,
    dailyViews: 89,
    weeklyGrowth: 5.6
  },
  {
    totalProducts: 765,
    activeProducts: 543,
    totalViews: 12345,
    totalFavorites: 345,
    avgPrice: 67.89,
    successRate: 72.3,
    dailyViews: 76,
    weeklyGrowth: 6.8
  },
  {
    totalProducts: 543,
    activeProducts: 432,
    totalViews: 9876,
    totalFavorites: 234,
    avgPrice: 234.56,
    successRate: 69.4,
    dailyViews: 54,
    weeklyGrowth: 7.2
  }
];

/**
 * 热门分类数据
 */
export const mockHotCategories = [
  {
    id: 'electronics',
    name: '电子产品',
    productCount: 1567,
    weeklyGrowth: 12.3
  },
  {
    id: 'books',
    name: '教材资料',
    productCount: 2345,
    weeklyGrowth: 8.7
  },
  {
    id: 'clothing',
    name: '服装服饰',
    productCount: 987,
    weeklyGrowth: 5.6
  },
  {
    id: 'daily',
    name: '生活用品',
    productCount: 765,
    weeklyGrowth: 6.8
  },
  {
    id: 'sports',
    name: '运动器材',
    productCount: 543,
    weeklyGrowth: 7.2
  }
];

export default {
  mockCategories,
  mockCategoryTree,
  mockCategoryStats,
  mockHotCategories
};